# Contributor: Newbyte <newbyte@disroot.org>
# Maintainer: Newbyte <newbyte@disroot.org>
pkgname=py3-watchfiles
pkgver=0.7
pkgrel=2
pkgdesc="Simple, modern file watching and code reload in Python"
url="https://github.com/samuelcolvin/watchfiles"
arch="noarch !s390x" # s390x: test_add fails
license="MIT"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-asyncio py3-pytest-mock py3-pytest-toolbox"
source="$pkgname-v$pkgver.tar.gz::https://github.com/samuelcolvin/watchgod/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/watchfiles-$pkgver"
options="!check" # does not work with new pytest

# renamed from py3-watchgod
provides="py3-watchgod=$pkgver-r$pkgrel"
replaces="py3-watchgod"

build() {
	python3 setup.py build
}

check() {
	# Fails on slow systems or when system is under heavy load.
	# See upstream issue #84
	pytest -k 'not test_awatch_log'
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
835f29287b0f47b3d3698bc799ed2d06bf45cddfe05958342f6d1a1d42184c7a50f85bde506a7b34a225a1d6d2e04d8af0635093dc3e8147d17e3a0c7769aecc  py3-watchfiles-v0.7.tar.gz
"
